<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    // ES5:
    function Cat(name, color) {
        this.name = name;
        this.color = color;
    }
    Cat.prototype.species = "cat";
    Cat.prototypr.call = function () {
        console.log("喵喵");
    }
    Cat.prototype.skill = function () {
        console.log("抓老鼠");
    }


    // ES6:
    class Cat {
        constructor(name, color) {
            this.name = name;
            this.color = color;
        }

        call() {
            console.log("喵喵");
        }
        skill() {
            console.log("抓老鼠");
        }
        say() {
            console.log(this.name, this.age);
        }

    }



</script>

</html>